﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using DbSharp.Framework.DbObject;

namespace DbSharp.Framework.Storage
{
    public interface IScalarStorage
    { 
        /// <summary>
        /// prepare somethings before saving scalar value
        /// </summary>
        void Initialize();

        /// <summary>
        /// save scalar value
        /// </summary>
        /// <param name="value">value</param>
        void Save(DbCmdScalarResult scalarResult);

        /// <summary>
        /// do something after saving records
        /// </summary>
        void Terminate();

        /// <summary>
        /// one XElement, it includes dataValue  
        XElement ScalarValueXElement { get; }

      
        
        /// <summary>
        /// get scalar text
        /// </summary>
        string ScalarText { get; }


        /// <summary>
        /// Return sorted field output name list
        /// </summary>
        /// <returns></returns>
        List<string> GetOutputFieldNameList();



        /// <summary>
        /// return the list of output field meta data, order by output name
        /// </summary>
        /// <returns></returns>
        List<FieldMetaData> GetOutputFieldMetaDataQueue();
        


    }
}
